from gaoyi.lianxi.base import Base
from selenium.webdriver.common.by import By
from time import sleep

class KongfzPage(Base):
    wode = (By.ID,'com.kongfz.app:id/lav_5')
    #账号输入框
    zhanghao = 'new UiSelector().resourceId("com.kongfz.app:id/et_login_name")'
    mima = 'new UiSelector().text("请输入密码")'
    xieyi = (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.TextView[1]')
    denglu = (By.XPATH,'//android.widget.TextView[@resource-id="com.kongfz.app:id/tv_confirm_btn"]')

    dy = (By.XPATH,'//android.widget.TextView[@text="请输入账号密码"]')

    def loginyewu(self,name,password):
        self.find_ele(self.wode).click()
        sleep(12)
        self.find_ele(self.zhanghao).send_keys(name)
        sleep(2)
        self.find_ele(self.mima).send_keys(password)
        sleep(2)
        self.find_ele(self.xieyi).click()
        sleep(2)
        self.find_ele(self.denglu).click()
        sleep(2)
